<% if @article.errors.any? %>
ui.dialog('<%= sanitize @article.errors.full_messages.join(', ') %>')
        .closable().show().hide(15000);
<% else %>
ui.dialog('<%= @article.published_at.blank? ? "成功取消发布!" : "发布成功" %>').closable().show().hide(3000);
$('#a----<%= @article.id %>').replaceWith('<%= j render 'article', article: @article %>');
<% end %>